package com.clt.ess.service.impl;


import com.clt.ess.dao.AdminInfoMapper;
import com.clt.ess.entity.AdminInfo;
import com.clt.ess.service.AdminInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminInfoServiceImpl implements AdminInfoService {

    @Autowired
    private AdminInfoMapper adminInfoMapper;

    @Override
    public AdminInfo findAdminInfoByPhone(String phone) {
        return adminInfoMapper.findAdminInfoByPhone(phone);
    }

    @Override
    public Integer addAdminInfo(AdminInfo adminInfo) {
        AdminInfo info = adminInfoMapper.findAdminInfoByPhone(adminInfo.getPhone_num());
        if(info == null){
            adminInfoMapper.addAdminInfo(adminInfo);
        }
        return null;
    }
}
